const { chatGptService } = require('./request');
const { CHATGPT_MODEL } = require('../config');

const getReply = (messageList, headers) => {
    return chatGptService({
        url: '/v1/chat/completions',
        method: 'post',
        headers,
        data: {
            model: CHATGPT_MODEL,
            messages: messageList,
            temperature: 0.6
        },
    })
}

const getImage = (prompt, headers) => {
    return chatGptService({
        url: '/v1/images/generations',
        method: 'post',
        headers,
        data: {
            prompt
        },
    })
}

module.exports = {
    getReply,
    getImage
}